﻿using System.Collections.Generic;
using AdventureWorks.Domain;
using AdventureWorks.DataAccess.Utils;
using AdventureWorks.DataAccess.repository;
using System.Linq;

namespace AdventureWorks.DataAccess.Task
{
    public class PersonTask : IPersonTask
    {
        public IEnumerable<Person> GetPeopleWithContacts()
        {
            using (var session = SessionManager.SessionFactory.OpenSession())
            {
                var personRepository = new PersonRepository();
                return personRepository.GetPeople(session).ToList();
            }
        }
    }
}
